<div class="bjui-pageContent">
    <button type="button" class="btn-default" data-toggle="dialog" data-options="{
            id:'purchasing-examine-process-edit-dialog',
            url:'/admin/examine/editPurchasingExamineProcess',
            width:800,
            height:500,
            title:'添加'
        }">
        添加
    </button>
    <table class="table table-bordered" data-toggle="datagrid" data-options="{
        height: '100%',
        gridTitle : '工序管理',
        showToolbar: false,
        toolbarItem: 'add',
            editMode: 'dialog',
            local: 'local',
            dataUrl: 'admin/examine/getPurchasingExamineProcessData?callback=?',
            dataType: 'jsonp',
            editUrl: '/admin/order-type/edit',
            delUrl: '/admin/order-type/del',
            delPK: 'id',
            linenumberAll: true,
            sortAll: false,
            contextMenuH: true,
            contextMenuB: true,
            inlineEditMult: false,
            paging: {showPagenum:10, selectPageSize:'20,50,100', pageCurrent:1, pageSize:20},
            showEditbtnscol: false,
            customEditbtns: {width:200,position:'replace'},
            fullGrid: true,
            fieldSortable: false,
            filterThead: false,
            columnMenu: false,
        }">
        <thead>
        <tr>
            <th data-options="{name:'title',align:'center',width:100}">标题</th>
            <th data-options="{name:'user_name',align:'center',width:100}">审核人</th>
            <th data-options="{align:'center',width:200,render:process_manage}">管理</th>
        </tr>
        </thead>
    </table>
</div>
<script>
    function get_process(value, data){
        var html = '';
        $(value).each(function(){
            html += ('步骤'+this.pivot.step_number+':'+this.title+'<br>');
        })
        return html;
    }
    function process_manage(value, data){
        var html= '<button type="button" class="btn btn-green" data-toggle="dialog" data-options="{id:\'purchasing-examine-process-edit-dialog\',fresh:true, url:\'/admin/examine/editPurchasingExamineProcess\', title:\'编辑\',width:800,height:500, data:{process_id:' + data.id + '}}"><i class="fa fa-edit"></i> 编辑</button>';
        html += '<button type="button" class="btn-red" data-toggle="del.datagrid.tr">删除</button>';
        return html
    }

    function datagrid_tree_operation(){
        return ' <button type="button" class="btn btn-red bjui-datagrid-btn delete"><i class="fa fa-remove"></i> 删除</button>'
    }

</script>
